﻿Imports IICBusinessLogic.DataConversion
Imports IICModel.DataConbversionLogic
Imports IICModel

Public Class ConversionMain

    Public Shared Sub main()


        ModelContext.newCurrent(Environment.UserName)
        Model.ModelContext.CurrentDBUtils = BaseDataConverter.newDBConnection

        DBUpdater.dbUpdateVersion(Model.ModelContext.CurrentDBUtils, _
                                  DBVersion.SYSTEM_DATABASE_VERSION, _
                                  GetType(IICModel.BusObjects.Lesson).Assembly)
        Try
            ModelContext.beginTrans()

            Dim d As New DASUpdate
            d.reverseAllDASPeriods()

            Dim dsm As New IICBusinessLogic.PasDasStructureManager()
            dsm.updateDASStructure()
            d.processDASPeriods()
            ModelContext.commitTrans()
        Finally
            ModelContext.rollbackTrans()
        End Try


    End Sub
End Class
